﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Zatify.Domain.Data;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Zatify.WebUI.Admin.Models
{
    public class BusinessViewModel
    {
        public int? BusinessId { get; set; }

        [Required(ErrorMessage = "* User ID required")]
        [Remote("BusinessIDUnique", "Business", AdditionalFields="BusinessId", ErrorMessage = "User ID must be unique.")]
        public string UserId { get; set; }

        [Required(ErrorMessage = "* Password required")]
        public string Password { get; set; }

        [Required(ErrorMessage = "* Confirm Password required")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [Required(ErrorMessage = "* Business Name required")]
        public string BusinessName { get; set; }

        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Please enter a valid e-mail adress")]
        //[Required(ErrorMessage = "* Email required")]
        public string Email { get; set; }

        //[Required(ErrorMessage = "* Web required")]
        public string Web { get; set; }

        //[Required(ErrorMessage = "* Bussines Phone required")]
        public string BusinessPhone { get; set; }

        //[Required(ErrorMessage = "* Cell Phone required")]
        public string CellPhone { get; set; }


        public string TollFreePhone { get; set; }
        public string Fax { get; set; }

        //[Required(ErrorMessage = "* Street Address required")]
        public string StreetAddress1 { get; set; }

        public string StreetAddress2 { get; set; }

        //[Required(ErrorMessage = "* City required")]
        public string City { get; set; }

        public string StateCode { get; set; }

        //[Required(ErrorMessage = "*")]
        [RegularExpression(@"^\d{5}(-\d{4})?$", ErrorMessage = " Zip code must be 5 characters length")]
        public string ZipCode { get; set; }

        //[Required(ErrorMessage = "*")]
        public string Description { get; set; }

        public byte[] Picture { get; set; }
        public string PictureContentType { get; set; }

        public double? Longitude { get; set; }
        public double? Latitude { get; set; }

        public Category[] Categories { get; set; }

        #region BusinessHours

        public bool IsBusinessHoursSpecified { get; set; }

        public TimeSpan MonFrom { get; set; }
        public TimeSpan MonTo { get; set; }
        public bool MonClosed { get; set; }
        public bool Mon24HoursOpen { get; set; }

        public TimeSpan TueFrom { get; set; }
        public TimeSpan TueTo { get; set; }
        public bool TueClosed { get; set; }
        public bool Tue24HoursOpen { get; set; }

        public TimeSpan WedFrom { get; set; }
        public TimeSpan WedTo { get; set; }
        public bool WedClosed { get; set; }
        public bool Wed24HoursOpen { get; set; }

        public TimeSpan ThuFrom { get; set; }
        public TimeSpan ThuTo { get; set; }
        public bool ThuClosed { get; set; }
        public bool Thu24HoursOpen { get; set; }

        public TimeSpan FriFrom { get; set; }
        public TimeSpan FriTo { get; set; }
        public bool FriClosed { get; set; }
        public bool Fri24HoursOpen { get; set; }

        public TimeSpan SatFrom { get; set; }
        public TimeSpan SatTo { get; set; }
        public bool SatClosed { get; set; }
        public bool Sat24HoursOpen { get; set; }

        public TimeSpan SunFrom { get; set; }
        public TimeSpan SunTo { get; set; }
        public bool SunClosed { get; set; }
        public bool Sun24HoursOpen { get; set; }

        #endregion
    }
}